module.exports = options => {
    return async function authHandler(ctx, next) {
        if (ctx.isAuthenticated()) {
            await next();
        } else {
            const code = 401
            ctx.body = {
                code
            }
            ctx.status = code
        }
    };
};